package cn.sirun.com.fca.account.uitl;

import android.util.Pair;

import com.tencent.cloud.iov.common.flow.view.impl.BaseLoadingFlowView;
import com.tencent.cloud.iov.kernel.util.ExceptionUtils;
import com.tencent.cloud.uikit.utils.DialogUtils;

/**
 * @author vinsonhuang
 * @date 2018/10/25
 */
public class RequestExceptionUtils {

    public static void handleException(BaseLoadingFlowView flowView, Throwable throwable) {
        // 处理本地异常消息
        Pair<Integer, String> pair = ExceptionUtils.handleThrowable(throwable);
        // 隐藏加载动画
        flowView.hideLoadingView();
        // 显示本地异常信息
        DialogUtils.showToast(flowView.getActivity(), pair.second);
    }
}
